Skip to content

feat/real cost reconciliation - #30

Merged
minixalpha merged 5 commits into
mainfrom
feat/real-cost-reconciliation
Sep 2, 2026
Merged

feat/real cost reconciliation#30
minixalpha merged 5 commits into
mainfrom
feat/real-cost-reconciliation

Conversation

@minixalpha

@minixalpha minixalpha commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • capture provider-reported model-call costs directly from response usage when available, otherwise preserve pending generation IDs and reconcile them through the provider-local Generation API
  • handle delayed billing records with bounded exponential retries, distinguish retryable and permanent failures, and persist credential-free per-attempt diagnostics in terminal Journal and ATIF metadata
  • project resolved per-step costs, complete run totals, and explicit partial-cost state into ATIF trajectories without treating unknown costs as zero
  • support both API-key and bearer-token authentication for reconciliation, and document the OpenRouter Anthropic-compatible configuration in both READMEs
  • update the bilingual Event Journal protocol, 0.8.x development notes, changelog, and automated coverage for direct, delayed, failed, and auth-token reconciliation paths

Testing

  • uv run pytest — 188 passed
  • real OpenRouter smoke test confirmed two initial 404 responses followed by a resolved total_cost on the third lookup
  • Harbor 0.21.0 trajectory validator accepted the generated ATIF artifact

@minixalpha
minixalpha merged commit 83e6271 into main Sep 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant